.PHONY:clean build


ifeq ($(OS),Windows_NT)
  PLATFORM="MinGW Makefiles"
else
 ifeq ($(shell uname),Darwin)
  PLATFORM="MacOS"
 else
  PLATFORM="Unix Makefiles"
 endif
endif

all:clean build run

clean:
	- rm -rf build

build:src/main.cpp
	cmake --no-warn-unused-cli \
	-DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE \
	-DCMAKE_BUILD_TYPE:STRING=Debug \
	-S. \
	-Bbuild -G $(PLATFORM)
	cmake --build build --config Debug --target all -j 4 --

run:
	./build/hello